<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Apple (programming language)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Apple_(programming_language)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Apple_programming_language rootpage-Apple_programming_language skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Apple (programming language)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Not to be confused with <a href="Apple_Inc." title="Apple Inc.">Apple Inc.</a> or <a href="AppleScript" title="AppleScript">AppleScript</a>.</div>
<p><b>Apple</b> is a <a href="PL/I" title="PL/I">PL/I</a> dialect programming language created by <a href="General_Motors_Research_Laboratories" title="General Motors Research Laboratories">General Motors Research Laboratories</a> for their <a href="Control_Data_Corporation" title="Control Data Corporation">Control Data Corporation</a> <a href="CDC_STAR-100" title="CDC STAR-100">STAR-100</a> supercomputer.
</p><p>Apple is a subset of full PL/I, but has been extended to integrate with the <a href="Associative_Programming_Language" title="Associative Programming Language">Associative Programming Language</a> (APL – not to be confused with <a href="APL_(programming_language)" title="APL (programming language)">APL (programming language)</a> )<sup id="cite_ref-refman_1-0" class="reference"><a href="#cite_note-refman-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: p.9">: p.9 </span></sup><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: p.92">: p.92 </span></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Associative_programming_features">Associative programming features</h2></div>
<table border="0">
<tbody><tr>
<th>
</th>
<td colspan="2"><b>Data types</b>
</td></tr>
<tr>
<td valign="top">Entity
</td>
<td>"The ENTITY attribute specifies a variable that
<p>may be manipulated by the INSERT, REMOVE, FIND, and FOR EACH statements."<sup id="cite_ref-refman_1-1" class="reference"><a href="#cite_note-refman-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: p.94">: p.94 </span></sup>
</p>
</td></tr>
<tr>
<td valign="top">Set
</td>
<td>"The SET attribute defines the name of a data aggregate that
<p>represents an ordered set of entity variables."<sup id="cite_ref-refman_1-2" class="reference"><a href="#cite_note-refman-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: p.107">: p.107 </span></sup>
</p>
</td></tr>
<tr>
<td valign="top">File_Set
</td>
<td>A File_Set is a SET that is contained in an external file.
</td></tr></tbody></table>
<table border="0">
<tbody><tr>
<th>
</th>
<td colspan="2"><b>Statements</b>
</td></tr>
<tr>
<td valign="top">Create
</td>
<td>Create is a synonym for Allocate. It causes storage to be allocated for a based variable. A file or set where the data is to be allocated may be specified.
</td></tr>
<tr>
<td valign="top">Delete
</td>
<td>Delete is a synonym for Free. Delete frees a based variable and optionally removes it from all sets of which it is a member.
</td></tr>
<tr>
<td valign="top">Find
</td>
<td>Locate an entity that is a member of a set or container based on specified conditions. An optional <code>ELSE</code> clause is executed if no entities are found.
</td></tr>
<tr>
<td valign="top">For Each
</td>
<td>Heads a group of statements to be executed for all entities or sets matching a specified condition.
</td></tr>
<tr>
<td valign="top">Insert
</td>
<td>Insert an entity into a specified set. Optionally, the placement of the new entity relative to other elements of the set may be specified.
</td></tr>
<tr>
<td valign="top">Let
</td>
<td>Set a locator variable to reference a specified set.
</td></tr>
<tr>
<td valign="top">Remove
</td>
<td>Remove an entity from a set.
</td></tr></tbody></table>
<table border="0">
<tbody><tr>
<th>
</th>
<td><b>Builtin function</b>
</td></tr>
<tr>
<td valign="top">ALL
</td>
<td>performs various operations on all members of a set, depending on the context in which it appears.
</td></tr>
<tr>
<td valign="top">APLESET
</td>
<td>returns a value indicating whether or not a file-set has been created.
</td></tr>
<tr>
<td valign="top">APLEVAR
</td>
<td>returns a pointer to the entity containing the set specified by its argument, or <code>NULL</code> if the set is a file-set.
</td></tr>
<tr>
<td valign="top">APLINDX
</td>
<td>
</td></tr>
<tr>
<td valign="top">APLNUMB
</td>
<td>
</td></tr>
<tr>
<td valign="top">APLOWNI
</td>
<td>
</td></tr>
<tr>
<td valign="top">APLOWRS
</td>
<td>
</td></tr>
<tr>
<td valign="top">APLSNAM
</td>
<td>
</td></tr>
<tr>
<td valign="top">APLTYPE
</td>
<td>
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Other_features">Other features</h2></div>
<p>An <code>OFFSET</code> variable identifies the relative location of a based variable in the containing file. A <code>DESCRIPTOR</code> variable resembles a pointer variable, but also contains the length of the associated based variable in addition to its address.
</p><p>The <code>LOCK</code> statement puts a program into "locked status", where all asynchronous events will be queued. A corresponding <code>UNLOCK</code> statement puts the program in "unlocked status", capable of processing asynchronous events. All queued events will be processed.
</p>
<div class="mw-heading mw-heading3"><h3 id="Asynchronous_processing">Asynchronous processing</h3></div>
<p>Apple uses the PL/I <code>EVENT</code> data type to implement asynchronous processing.
</p><p>An event variable can be associated with an external action, such as a keypress at the user's terminal, by a system call. Each event has a "delay state" and a "completion state" associated with it. When the event associated with the action occurs, the event becomes complete, and remains complete until the program accesses the information associated with the event. Events can also be marked complete with a <code>SIGNAL</code> statement, rather than the PL/I standard assignment to the<code>COMPLETION</code> pseudovariable. An event can be put into a delay state by the <code>DELAY</code> pseudovariable, and recognition will remain deferred until the program resets the delay state.
</p><p>Events can be associated with "ON-Units", by the <code>ON EVENT</code> statement, similar to PL/I standard for conditions. The <code>REVERT</code> statement removes the association. When the event is recognized (complete and not delayed) the On-Unit is executed. This ON-Unit can access system information about the event using the <code>ONPTR</code> builtin function, which returns the address of an "Event Completion Block", and sets the event to complete.
</p>
<div class="mw-heading mw-heading3"><h3 id="Hardware_access">Hardware access</h3></div>
<p>The <code>REGISTER</code> storage class and the <code>INLINE</code> builtin subroutine allow access to STAR hardware features.
</p><p>A scalar arithmetic variable can be declared <code>REGISTER [register-specification]</code>. <code>register-specification</code> can be an unsigned integer constant 0..255 to specify one of the computer's hardware registers. If it is omitted the compiler will assign a register.
</p><p>The <code>INLINE</code> builtin subroutine inserts an arbitrary machine-language instruction into the compiled code. Except for the function code (operation code) and subcode of the instructions all operands can be numeric constants, variables, or arithmetic constants.
</p><p>Example:<sup id="cite_ref-refman_1-3" class="reference"><a href="#cite_note-refman-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: p.202">: p.202 </span></sup>
</p>
<pre> CALL INLINE("F8", 5, 0, SOURCE, 0, "20", 0, TARGET);
</pre>
<div class="mw-heading mw-heading3"><h3 id="Text_replacement">Text replacement</h3></div>
<p>The <code>LITERALLY</code> specification allows the programmer to specify replacement text to be substituted at compile time. The syntax is:
</p>
<pre> %DECLARE <identifier> LITERALLY [ (<parameter-list> ) ] <character-constant> ;
</pre>
<p>If <parameter-list> is not specified the compiler replaces all occurrences of <identifier> throughout the program with <character-constant>.If <parameter-list> is specified, the replacement character string is formed by replacing all occurrences of the parameter name with the corresponding argument.
</p><p>Example:
</p>
<pre> %DECLARE BITS LITERALLY(A1,A2) 'A1*A2*64';
I = BITS(J,B);
</pre>
<p>will generate the statement:
</p>
<pre> I=J*8*64;
</pre>
<div class="mw-heading mw-heading2"><h2 id="Omitted_PL/I_features">Omitted PL/I features</h2></div>
<p>Some features of standard PL/I are not included in Apple. The most significant are:<sup id="cite_ref-refman_1-4" class="reference"><a href="#cite_note-refman-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>The <code>CONTROLLED</code> and <code>AREA</code> storage attributes are not supported. <code>FILE</code> and <code>FILESET</code> have many of the characteristics of <code>AREA</code>.</li>
<li>List-directed and data-directed input and output are not supported.</li>
<li>Record input-output statements, including <code>READ</code>, <code>WRITE</code>, <code>REWRITE</code>, <code>LOCATE</code>, and <code>DELETE</code>. <code>DELETE</code> is used as a synonym for <code>FREE</code> when deleting <code>ENTITY</code> variables.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-refman-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-refman_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-refman_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-refman_1-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-refman_1-3"><sup><i><b>d</b></i></sup></a> <a href="#cite_ref-refman_1-4"><sup><i><b>e</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFKrullMarcottyPickettThomas1972" class="citation book cs1">Krull, Fred; Marcotty, Michael; Pickett, Mary; Thomas, James; Zeilinger, Ronald (1972). <a rel="nofollow" class="external text" href="https://bitsavers.org/pdf/gmResearchLaboratories/Apple_Programming_Language_Reference_Manual_Mar72.pdf"><i>Apple Reference Manual</i></a> <span class="cs1-format">(PDF)</span>. General Motors Research Laboratories<span class="reference-accessdate">. Retrieved <span class="nowrap">June 29,</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFBachman2006" class="citation book cs1">Bachman, Charles (January 2006). <a rel="nofollow" class="external text" href="https://dl.acm.org/doi/abs/10.1145/1141880.1141882"><i>An interview with Charles W. Bachman</i></a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1141880.1141882">10.1145/1141880.1141882</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-4503-1771-9</bdi><span class="reference-accessdate">. Retrieved <span class="nowrap">June 29,</span> 2024</span> – via ACM Digital Library.</cite>"George [Dodd] built a very attractive IDS like system, called 'Associative Programming Language' (APL)
which was integrated with PL/1. General Motors used it extensively in the graphic design system for
automotive development. IBM latter asked GM to give up the initials, APL, so they could use them with
their, 'A Programming Language.'”</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://dl-acm-org.wikipedialibrary.idm.oclc.org/doi/10.1145/1464291.1464363">APL: a language for associative data handling in PL/I</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-04-14" href="https://en.wikipedia.org/wiki/?title=Apple_(programming_language)&oldid=1285500518">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>